home *** CD-ROM | disk | FTP | other *** search
- ** Common Questions and Answers **
- ** About MICRO-C, XASM and EMILY **
-
- Q: Is MICRO-C a full ANSI compiler?
-
- No, MICRO-C is a "subset" compiler. It does however, support much more
- of the 'C' language than most other subset compilers, including:
-
- - All 'C' statements:
- if/else while do/while for break continue
- return goto switch/case/default {} ;
-
- - All 'C' operators:
- + - * / % & | ^ << >> > < == ~ ++ -- ?: , . ->
- += -= *= /= %= &= |= ^= <<= >>= >= <= != ! () [] sizeof
-
- - The following data types:
- int char unsigned (including: unsigned char)
- struct union extern static register
- *(pointer to any type, incl. pointers and structs)
- - Arrays of any type (incl. multi-dimension, pointers & structs)
- - Function can return any type
- - Typecast of symbols to other types
-
- - Decimal, Octal and Hex constants. eg: 127, 0177, 0x7f
-
- - Inline assembly code (single or multi statement).
-
- - Full support for strings and character constants: ('' "")
- \n -Newline \r -Carriage return \t -Tab
- \b -Backspace \f -Formfeed
- \177 -Octal constants \x7F -Hexidecimal constants
- (16 bit character constants are supported. eg: 'ab')
-
- - Preprocessor commands:
- #define (fully parameterized & multi-line)
- #undef
- #forget (multi undef -similar to FORTH forget)
- #include
- #ifdef/#ifndef/#else/#endif (fully nested)
- #file (sets filename displayed in error messages)
-
- - It DOES NOT support:
- Typedef, Long / Double / Float / Enumerated data types, Bit fields.
-
- Q: Is MICRO-C just another version of SMALL-C?
-
- No, MICRO-C is a completely new design, with several advantages:
- - Supports more of the 'C' language: unsigned int & char, pointers to
- pointers, arrays of pointers, multi-dim arrays, typecasting, sizeof,
- parameterized and multi-line defines, multiple code generators...
- - Much more efficent code generated. For a given function, MICRO-C
- usually produces 1/3 to 1/2 the amount of code that SMALL-C does.
- - Faster compilation: MICRO-C employs a fully tokenized parser,
- which results in MUCH faster compilation than SMALL-C.
- - More portable: MICRO-C was designed from the beginning to be
- portable to many machine architectures.
- Q: Does MICRO-C run on a (Macintosh, UNIX box, etc...)?
-
- Although MICRO-C is distributed mainly for the IBM PC, the compiler can
- be re-compiled to run in virtually any environment. The sources to the
- compiler are in 'C', and were written to be very portable. You will need
- a 'C' compiler for the target system. If you don't already have a cross
- assembler for the target system, you can purchase the source to our XASM
- assemblers, and re-compile them to the target as well.
-
- Note: If you are really ambitious (or desparate!), you can port MICRO-C
- to a system without a 'C' compiler, by first porting MICRO-C into a cross
- compiler for the target system, and using it to re-compile itself!
-
- Q: Does MICRO-C output assembly or object code?
-
- MICRO-C outputs assembly language code. A command line options allows
- you in include the 'C' source code as comments.
-
- Q: Can I use my own assembler with MICRO-C, or do I need XASM?
-
- The code generators that we supply for MICRO-C are designed to be
- compatible with our XASM cross assemblers. In most cases, they can
- be modified to work with another assembler with little difficulty.
-
- Beginning with version 3.0 of MICRO-C, we are now including the
- source code to the assembler as part of each porting package, so
- you shouldn't have to worry about it. If you do have a compelling
- reason to use a different assembler, it can be done.
-
- Q: What if my assembler doesn't support a linker?
-
- The MICRO-C package includes SLINK, a "SOURCE LINKER", which allows
- the 'C' library to be properly implemented even if your system does
- not have an object linker. SLINK uses "directives" inserted in the
- output file by the compiler to include library files that contain
- functions or variables that you have accessed BEFORE your program
- is assembled. SLINK only includes those files that are necessary,
- and automatically "adjusts" local labels to be unique in each file.
-
- SLINK is very fast. If your assembler is reasonably quick, you will
- get total compile times that are similar to what you would get with
- a conventional object linker. A nice thing about this approach to
- linking, is that you can get an assembly language listing for the
- ENTIRE program (including start-up code and library functions).
-
- --- Over --->
- Q: How much code can I fit in (nK) of memory?
-
- That depends on so many factors that its impossible to give you a general
- answer. It is usually more that you would think, because MICRO-C produces
- fairly compact code. This is especially true with our "Developers Kits",
- because their libraries are hand-coded in assembly language, using very
- tight code. Here are some examples of appications:
-
- MICRO-C Compiler (compiled itself!) 24K
- ANSI terminal with built in XMODEM file transfer 10K
- Combination lock (rotary encoder, led indicator) 2K
- Telephone "distinctive ring" switcher (1 - 3 lines) 1.5K
-
- Q: Does MICRO-C support the (insert favorite processor)?
-
- See the CATALOG for a list of processors which we directly support.
-
- If your processor is based one of the processors listed in our CATALOG
- (such as 8051 variants, which have additional SFR's etc.), you should
- have no problem using MICRO-C, because the compiler uses the basic CPU
- instruction set, and you can easily add library functions and/or register
- definitions to allow you to access the additional features.
-
- If you wish to use MICRO-C on a processor which is not based on one of
- the ones we support, you can still do so, with a bit more work. You would
- have to "port" the compiler by writing a code generator for the particular
- processor you have in mind. The MICRO-C documentation includes a detailed
- section on how to "port" the compiler, however this is not a task for the
- novice 'C' programmer. Before attempting this, please check with us. We
- may already be planning a release for the processor you want (or perhaps
- you can "convince" us that is would be a good idea).
-
- Q: Is MICRO-C really as good as you say it is?
-
- Sturgeons Rule has it that 90% of science fiction is junk. A similar rule
- applies to PC software, but I'd say that 90% is a lower bound. Once in a
- while, though, you find a product that makes up for the rest...
- If price has kept you out of the microcontroller C market, you have no
- further excuses. Micro-C is as good as it gets!
- - Circuit Celler INK Dec91/Jan92
-
- I just obtained Micro C, and I'm very impressed!...
- The portability of Micro C is second-to-none, as is it's professionally
- written code and overall usability... I need to emphasize here that
- Micro C is by far the best coded compiler I've ever seen. This excellent
- code quality extends throughout all associated modules.
- - FIDOnet 'C' programmers echo
-
- Dave, Thanks for responding to the minor problem I had with your
- wonderful little compiler.
- - A satisifed customer
- Q: How does EMILY51/52 compare with a hardware In Circuit Emulator (ICE)?
-
- EMILY is a very fast simulator (>150,000 insts/sec on my 386/25),
- however it is not as fast as an ICE which operates at full CPU speed.
-
- My tests have shown EMILY on my machine to be roughly equivalent to a 4Mhz
- 8052. For example, one my customers recently reported that an algorithm
- he had calculated would take about 1 second on a 12Mhz 8052 took 3 seconds
- under EMILY. In contrast, the same program took over 20 MINITES when run
- with another popular commercial simulator.
-
- EMILY with its Hardware Emulation option permits access to the timers and
- I/O ports of the hardware, however external memory on the target system
- cannot be accessed (EMILY provides its own code and data areas using the
- PC's memory). This is usually only important if you have hardware which
- is accessed through the external memory address space.
-
- At present, EMILY does not act on interrupts from the target system, but
- allows you to simulate them from the PC keyboard. When an interrupt is
- simulated, EMILY sets any hardware bits which would normally be set when
- the interrupt occurs, and then vectors to the interrupt handler. Although
- this prevents you from using "real time" interrupts, I have found it to be
- a very effective approach when debugging interrupt handlers. You can stop
- the simulation at any point, inject an interrupt, and then step through the
- interrupt handler etc.
-
- EMILY has a 4095 instruction traceback buffer which operates in all
- execution modes, however it only records the instructions executed. In
- other words, you can scroll/search through the last 4095 instructions
- which were executed in order to see "how it got here". More expensive
- ICE's often have traceback buffers which record both the address and
- data bus activity.
-
- EMILY is much less expensive then any ICE.
-
- EMILY now includes MONICA, a PC hosted debugger, that debugs ON-CHIP,
- by downloading your code, and controlling it through the a tiny on-
- board kernal program. MONICA's user interface is virtually identical
- to EMILY's, and the kernal is upward compatible with EMILY. This means
- that you can easily switch back and forth between EMILY and MONICA, and
- use whichever is best suited to the debugging at hand.
-